/*
 * Created on Mar 26, 2011
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.timber.util;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;


import com.timber.tableModels.InvColumnManager;

/**
 * @author joju.varghese
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class IteamBean extends SLDataObjectAdaptor implements Serializable {
	             						
	/**
	 * @return Returns the auditInformation.
	 */
	public String getAuditInformation() {
		return AuditInformation;
	}
	/**
	 * @param auditInformation The auditInformation to set.
	 */
	public void setAuditInformation(String auditInformation) {
		AuditInformation = auditInformation;
	}
	/**
	 * @return Returns the comments.
	 */
	public String getComments() {
		return Comments;
	}
	/**
	 * @param comments The comments to set.
	 */
	public void setComments(String comments) {
		Comments = comments;
	}
	/**
	 * @return Returns the companyName.
	 */
	public String getCompanyName() {
		return CompanyName;
	}
	/**
	 * @param companyName The companyName to set.
	 */
	public void setCompanyName(String companyName) {
		CompanyName = companyName;
	}
	/**
	 * @return Returns the itemClass.
	 */
	public String getItemClass() {
		return ItemClass;
	}
	/**
	 * @param itemClass The itemClass to set.
	 */
	public void setItemClass(String itemClass) {
		ItemClass = itemClass;
	}
	/**
	 * @return Returns the itemCode.
	 */
	public String getItemCode() {
		return ItemCode;
	}
	/**
	 * @param itemCode The itemCode to set.
	 */
	public void setItemCode(String itemCode) {
		ItemCode = itemCode;
	}
	/**
	 * @return Returns the itemId.
	 */
	public int getItemId() {
		return ItemId;
	}
	/**
	 * @param itemId The itemId to set.
	 */
	public void setItemId(int itemId) {
		ItemId = itemId;
	}
	/**
	 * @return Returns the itemName.
	 */
	public String getItemName() {
		return ItemName;
	}
	/**
	 * @param itemName The itemName to set.
	 */
	public void setItemName(String itemName) {
		ItemName = itemName;
	}
	/**
	 * @return Returns the length.
	 */
	public double getLength() {
		return Length;
	}
	/**
	 * @param length The length to set.
	 */
	public void setLength(double length) {
		Length = length;
	}
	/**
	 * @return Returns the location.
	 */
	public String getLocation() {
		return Location;
	}
	/**
	 * @param location The location to set.
	 */
	public void setLocation(String location) {
		Location = location;
	}
	/**
	 * @return Returns the lotNumber.
	 */
	public String getLotNumber() {
		return LotNumber;
	}
	/**
	 * @param lotNumber The lotNumber to set.
	 */
	public void setLotNumber(String lotNumber) {
		LotNumber = lotNumber;
	}
	/**
	 * @return Returns the measurement.
	 */
	public String getMeasurement() {
		return Measurement;
	}
	/**
	 * @param measurement The measurement to set.
	 */
	public void setMeasurement(String measurement) {
		Measurement = measurement;
	}
	/**
	 * @return Returns the parent.
	 */
	public int getParent() {
		return Parent;
	}
	/**
	 * @param parent The parent to set.
	 */
	public void setParent(int parent) {
		Parent = parent;
	}
	/**
	 * @return Returns the profitMargin.
	 */
	public double getProfitMargin() {
		return ProfitMargin;
	}
	/**
	 * @param profitMargin The profitMargin to set.
	 */
	public void setProfitMargin(double profitMargin) {
		ProfitMargin = profitMargin;
	}
	/**
	 * @return Returns the purchasedDate.
	 */
	public String getPurchasedDate() {
		return PurchasedDate;
	}
	/**
	 * @param purchasedDate The purchasedDate to set.
	 */
	public void setPurchasedDate(String purchasedDate) {
		PurchasedDate = purchasedDate;
	}
	/**
	 * @return Returns the purchasedFrom.
	 */
	public String getPurchasedFrom() {
		return PurchasedFrom;
	}
	/**
	 * @param purchasedFrom The purchasedFrom to set.
	 */
	public void setPurchasedFrom(String purchasedFrom) {
		PurchasedFrom = purchasedFrom;
	}
	/**
	 * @return Returns the purchasePrice.
	 */
	public double getPurchasePrice() {
		return PurchasePrice;
	}
	/**
	 * @param purchasePrice The purchasePrice to set.
	 */
	public void setPurchasePrice(double purchasePrice) {
		PurchasePrice = purchasePrice;
	}
	/**
	 * @return Returns the quantity.
	 */
	public double getQuantity() {
		return Quantity;
	}
	/**
	 * @param quantity The quantity to set.
	 */
	public void setQuantity(double quantity) {
		Quantity = quantity;
	}
	/**
	 * @return Returns the salesPrice.
	 */
	public double getSalesPrice() {
		return SalesPrice;
	}
	/**
	 * @param salesPrice The salesPrice to set.
	 */
	public void setSalesPrice(double salesPrice) {
		SalesPrice = salesPrice;
	}
	/**
	 * @return Returns the tax.
	 */
	public double getTax() {
		return Tax;
	}
	/**
	 * @param tax The tax to set.
	 */
	public void setTax(double tax) {
		Tax = tax;
	}
	/**
	 * @return Returns the type.
	 */
	public String getType() {
		return Type;
	}
	/**
	 * @param type The type to set.
	 */
	public void setType(String type) {
		Type = type;
	}
	/**
	 * @return Returns the width.
	 */
	public double getWidth() {
		return Width;
	}
	/**
	 * @param width The width to set.
	 */
	public void setWidth(double width) {
		Width = width;
	}

	int ItemId ;
	int Parent  ;              						
	String	Type ;                   				     	
	String	ItemCode;  
	String	ItemName ;             						
	String	ItemClass ;     							
	String	Location   ;                                  	   	
	String	LotNumber   ;   							
	double	Length       ;    							   	
	double	Width         ; 									
	String	Measurement    ;      								
	double	Quantity        ;  								
	double	PurchasePrice    ;  								
	double	SalesPrice      	;							
	double	ProfitMargin         ;								
	String	PurchasedFrom			;						
	String	PurchasedDate    		;						
	double	Tax            			;						
	String	AuditInformation    	;					
	String	Comments        		;				
	String	CompanyName;
	double	Amount            			;
	double 	Units;
	
	
	
	/**
	 * @return Returns the amount.
	 */
	public double getAmount() {
		return Amount;
	}
	/**
	 * @param amount The amount to set.
	 */
	public void setAmount(double amount) {
		Amount = amount;
	}
	
	String ITEM_ID    		 ="ItemId"			;
	String ITEM_CODE    	 ="ItemCode"			;
	String	PARENT			 ="Parent"           ;   
	String	TYPE			 ="Type"             ;   
	String	TIMBER_NAME		 ="ItemName"        ;	
	String	TIMBER_CLASS	 = "ItemClass"		;	
	String	LOCATION		 ="Location"         ;	
	String	LOTNUMBER		 ="LotNumber" 		;	
	String	TIMBER_LENGTH	 ="Length"  		;	
	String	TIMBER_WIDTH     ="Width"			;	
	String	MEASURMENT       ="Measurement"    	;	
	String	QUANTITY         ="Quantity"			;	
	String	PURCHASE_PRICE   ="PurchasePrice" 	;	
	String	SALESPRICE       ="SalesPrice"		;	
	String	PROFITMARGIN     ="ProfitMargin"   	;	
	String	PURCHASEDFROM	 ="PurchasedFrom"	;	
	String	PURCHASEDATE     ="PurchasedDate"	;	
	String	TAX            	 ="Tax"				;	
	String	COMMENTS         ="Comments"			;
	String	COMPANYNAME    	 ="CompanyName"		;
	String	AMOUNT    		  ="Amount"		;
	String	UNITS    		  ="Units"		;

	
	
	
	public boolean load(ResultSet rs) throws SQLException
	{
		 ItemId=rs.getInt(ITEM_ID);     
		 Type=rs.getString(TYPE); 
		 ItemCode	=rs.getString(ITEM_CODE);
		 ItemName	=rs.getString(TIMBER_NAME);
		 ItemClass	=rs.getString(TIMBER_CLASS);
		 Location	=rs.getString(LOCATION);
		 LotNumber	=rs.getString(LOTNUMBER);
		 Length =rs.getDouble(TIMBER_LENGTH);
		 Width =rs.getDouble(TIMBER_WIDTH);
		 Amount=0;
		 Quantity =rs.getDouble(QUANTITY);
		 Units =rs.getDouble(UNITS);
		 Measurement =rs.getString(MEASURMENT);
		 PurchasePrice =rs.getDouble(PURCHASE_PRICE);
		 SalesPrice = rs.getDouble(SALESPRICE);
		 ProfitMargin = rs.getDouble(PROFITMARGIN);
		 PurchasedFrom = rs.getString(PURCHASEDFROM);
		 PurchasedDate =rs.getDate(PURCHASEDATE)+"";
		 Tax = rs.getDouble(TAX);
		 CompanyName = rs.getString(COMPANYNAME);
		return true;
	}
	
	  public IteamBean()

	  {
	  }
	  
	
	
	  public IteamBean( IteamBean rawItem )

	  {

		 this.ItemId=rawItem.getItemId() ;
		 this.Type=rawItem.getType(); 
		 this.ItemCode	=rawItem.getItemCode();
		 this.ItemName	=rawItem.getItemName();
		 this.ItemClass	=rawItem.getItemClass();
		 this.Location	=rawItem.getLocation();
		 this.LotNumber	=rawItem.getLotNumber();
		 this.Length =rawItem.getLength();
		 this.Width =rawItem.getWidth();
		 this.Amount=0;
		 this.Quantity =rawItem.getQuantity();
		 this.Measurement =rawItem.getMeasurement();
		 this.PurchasePrice =rawItem.getPurchasePrice();
		 this.SalesPrice = rawItem.getSalesPrice();
		 this.ProfitMargin = rawItem.getProfitMargin();
		 this.PurchasedFrom = rawItem.getPurchasedFrom();
		 //this.PurchasedDate =rawItem.getPurchasedDate()+"";
		 this.Tax = rawItem.getTax();
		 this.CompanyName = rawItem.getCompanyName();
		 this.Units = rawItem.getUnits();
	    
	  }
	
	
	/**
	 * @return Returns the units.
	 */
	public double getUnits() {
		return Units;
	}
	/**
	 * @param units The units to set.
	 */
	public void setUnits(double units) {
		Units = units;
	}
}
